#ifndef NAMESPACE_H
#define NAMESPACE_H

#include <QtNetwork>
#include <QString>
#include <QMap>
#include <QList>
#include <QTextCodec>
#include "profile.h"

namespace byhh_variables {
    extern const QUrl server			;//("http://byhh.net/");
    extern const QString queryViewFavorite 	;//= "http://byhh.net/cgi-bin/bbsbrd";
    extern const QString queryAllBoard 		;//= "http://byhh.net/cgi-bin/bbsmybrd";
    extern const QString queryToLogin 		;//= "/cgi-bin/bbslogin?id=%1&pw=%2";
    extern const QString queryToLogout 		;//= "/cgi-bin/bbslogout";
    extern const QString queryViewBBS 		;//= "/cgi-bin/bbsboa?%1";
    extern const QString queryViewBoard 	;//= "/cgi-bin/bbstdoc?board=%1";
    extern const QString queryViewTopic 	;//= "/cgi-bin/bbstcon?board=%1&file=%2";
    extern const QString sendNewPost 		;//= "/cgi-bin/bbssnd?board=%1";
    extern const QString sendContent 		;//= "title=%1&signature=%2&start=0&text=%3";
    extern int _count ;
    //保存正在处理中的http连接
    extern QMap <int , QHttp *> httpMaps;
    //记录已经废弃的http连接，统一删除
    extern QList<QHttp *> toDelete;
    //byhh.net返回的页面编码是GBK
    extern QTextCodec * gbkcodec;// = QTextCodec::codecForName("GBK");
    extern int request (QHttp * http, Profile * profile, QString url = "/", QString type = "GET", QString text = "");
    extern QString fetchHtml(int num , bool error, QHttp * http = 0);
	    
}

#endif